package service;

import hibernateUtil.AccountDaoImpl;
import hibernateUtil.CorpsDao;
import hibernateUtil.DaypayrateDao;
import hibernateUtil.DevicekickDao;
import hibernateUtil.GMControl;
import hibernateUtil.GMControlDao;
import hibernateUtil.GameItemDao;
import hibernateUtil.GmtalkcontrolDao;
import hibernateUtil.Gmuserfords2Dao;
import hibernateUtil.GuildinfoDao;
import hibernateUtil.LeveldistributionDao;
import hibernateUtil.MailDao;
import hibernateUtil.PlayerInfoDao;
import hibernateUtil.PlayerserviceDao;
import hibernateUtil.RechargeuserDao;
import hibernateUtil.RedemptioncodeDao;
import hibernateUtil.Serverno1Dao;
import hibernateUtil.SevendaylevelDao;
import hibernateUtil.SystemmailDao;
import hibernateUtil.UserinfoDao;
import hibernateUtil.ViewselectionDao;
import io.AsyncCall;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import packethandler.ViewSelectionHandler;


public class DBService implements Service {
	public PlayerInfoDao playerInfoDAO = new PlayerInfoDao();
	public MailDao mailDao=new MailDao();
	public SystemmailDao systemmailDao=new SystemmailDao();
	public CorpsDao corpsDao=new CorpsDao();
	public GuildinfoDao guildinfoDao=new GuildinfoDao();
	public AccountDaoImpl accountDao=new AccountDaoImpl();
	public PlayerserviceDao playerserviceDao = new PlayerserviceDao();
	public Gmuserfords2Dao gmuserfords2Dao=new Gmuserfords2Dao();
	public RedemptioncodeDao redemptioncodeDao=new RedemptioncodeDao();
	public GmtalkcontrolDao gmtalkcontrolDao = new GmtalkcontrolDao();
	public UserinfoDao userinfoDao=new UserinfoDao();
	public Serverno1Dao serverno1Dao=new Serverno1Dao();
	
	public DaypayrateDao daypayrateDao = new DaypayrateDao();
	public DevicekickDao devicekickDao = new DevicekickDao();
	public ViewselectionDao viewselectionDao = new ViewselectionDao();
	public LeveldistributionDao leveldistributionDao = new LeveldistributionDao();
	public RechargeuserDao rechargeuserDao = new RechargeuserDao();
	public SevendaylevelDao sevendaylevelDao = new SevendaylevelDao();
	
	public GMControlDao gmControlDao = new GMControlDao();
	
	public GameItemDao gameItemDao = new GameItemDao();

	protected ExecutorService executor = new ThreadPoolExecutor(8,30,60L,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
	protected ExecutorService executorMail = new ThreadPoolExecutor(8,30,60L,TimeUnit.SECONDS,new LinkedBlockingQueue<Runnable>());
	
	
	public void schedule(AsyncCall call){
		executor.execute(call);
	}
	
	public void MailCall(AsyncCall call)
	{
		executorMail.execute(call);
	}

	@Override
	public String getId() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void startup() throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void shutdown() {
		// TODO Auto-generated method stub
		
	}
}
